const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  publicPath: process.env.NODE_ENV === 'production' ? '/qingqaqfun/' : '/',
  outputDir: 'dist/qingqaqfun',
  configureWebpack: {
    resolve: {
      alias: {
        '@': '/src/',
      },
    },
    devServer: {
      proxy: {
        '/api': {
          // target: 'http://qingqaq.fun:3000/api',
          target: 'http://localhost:3000/api',
          changeOrigin: true,
          ws: true,
          pathRewrite: {
            '^/api': '/'
          }
        },
        '/kanamv': {
          target: 'https://resource-1259042331.cos.ap-nanjing.myqcloud.com/kanamv',
          changeOrigin: true,
          ws: true,
          pathRewrite: {
            '^/kanamv': '/'
          }
        }
      }
    },
  },
})
